﻿/*-----------------------------------------------------------------------
 * <copyright file="StaffSelContainer.xaml.cs" company="O-RID">
 *     Copyright (c)2010 O-RID Co.,Ltd.
 * </copyright>
 * <author>Zhang jun</author>
 * <summary> 
 *          StaffSearchCtrl
 *          作成日：06/13/2010
 *          
 *          08/11/2010 增加 数据导出功能（除了SV和QC都可以使用这个功能）
 *          10/15/2010 增加 日志中记录用户查询条件。
 *          01/10/2011 增加 F 和 G JOB
 *          04/22/2011 增加 案件名和线路选择条件。调整查询框整体结构。
 *          04/22/2011 增加 线路查询按钮功能。
 *          04/25/2011 增加 判定A，判定B JOB种类。
 *          04/25/2011 增加 案件名子窗体查询功能。
 *          04/26/2011 增加 线路、案件名 LOG记录。
 *          05/25/2011 修改 JOB种类条件选择或移除"判定A,判定B,A,B"时出现的错误。
 *          07/06/2011 增加 ScriptType(帐票种类) 查询信息子窗体查询功能。
 *                     删除 帐票种类 相关手动代码。
 *                     增加 WordType（文字种类） 查询信息子窗体查询功能。
 *                     删除 文字种类 相关手动代码。
 *                     增加 JobClass（Job种类） 查询信息子窗体查询功能。
 *                     删除 Job种类 相关手动代码。
 *                 
 * </summary>
 *-----------------------------------------------------------------------
 */
namespace Orid.Management.Statistics.OperatorUnitMangement.Common.SearchCtrl
{
    using System;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Media;
    using Orid.Management.Statistics.OperatorUnitMangement.Common.FunctionList;
    using Orid.Management.Statistics.OperatorUnitMangement.Common.Window;
    using childWindow = Orid.Management.Statistics.OperatorUnitMangement.Common.Window;
    using Command = Orid.Management.Statistics.OperatorUnitMangement.Command;
    using Wcf = Orid.Management.Statistics.OperatorUnitMangement.Common.Service;

    /// <summary>
    /// 查询区域控件 StaffSelContainer
    /// </summary>
    public partial class StaffSelContainer : UserControl
    {
        #region 全局变量

        /// <summary>
        /// 当前查询框的名字（日志用）
        /// </summary>
        private string ctrlName = " 全员别查询公用框StaffSelContainer ";

        /// <summary>
        /// 记录当前选择的 DockPanel控件名
        /// </summary>
        private string strDockPanelName = string.Empty;

        /// <summary>
        /// 引用控件TAG值 
        /// </summary>
        private WCFServers.WCFCommonQueryRef.WCFCommonQueryClient wcfCommonQueryClient;

        /// <summary>
        /// 日志服务定义 wcfLogClient
        /// </summary>
        private WCFLog4Ref.WCFLog4Client wcfLogClient;

        /// <summary>
        /// 消息子窗体 errorMessbox
        /// </summary>
        private childWindow.MessageBox errorMessbox;

        /// <summary>
        /// 查询命令 导出命令 queryCcommand
        /// </summary>
        private Command.ICommand queryCcommand = null, exportComand = null;

        /// <summary>
        /// 记录用户查询条件
        /// </summary>
        /// <value>10/15/2010 Add</value>
        public string WhereIntorLogs
        {
            get;
            set;
        }

        /// <summary>
        /// 查询子窗体 lineSelectWin
        /// 04/22/2011 ADD v2.14
        /// </summary>
        childWindow.LineSelChildWin lineSelectWin = null;

        /// <summary>
        /// 案件名查询子窗体 matterNameSelectWin
        /// 04/25/2011 add v2.14
        /// </summary>
        childWindow.MatterNameSelChildWin matterNameSelectWin = null;

        /// <summary>
        /// 帐票种类查询子窗体 striptTypeSelectWin
        /// 07/05/2011 add v2.15
        /// </summary>
        childWindow.ScriptTypeSelChildWin striptTypeSelectWin = null;


        /// <summary>
        /// WordType（文字种类）查询子窗体 wrodTypeSelectWin
        /// 07/06/2011 增加 v2.15
        /// </summary>
        childWindow.WordTypeSelChildWin wrodTypeSelectWin = null;

        /// <summary>
        /// JobClass种类 查询子窗体 jobClassSelectWin
        /// 07/06/2011 增加 v2.15
        /// </summary>
        childWindow.JobClassSelChildWin jobClassSelectWin = null;

        #endregion 全局变量

        /// <summary>
        /// 构造函数 StaffSelContainer
        /// </summary>
        public StaffSelContainer()
        {
            InitializeComponent();
            this.InitField();

            // 引用主题
            ((App)Application.Current).SetTheme(LayoutRoot);
            //Accordion 时的Border 控件 引用主题
            ((App)Application.Current).SetTheme(bAccordionItemBorder);

            #region 对...按钮的单击事件 委托

            // 线路条件... 按钮 v2.14
            this.btnSelContext.Click += new RoutedEventHandler(btnSelContext_Click);
            // 线路查询子窗体关闭事件 v2.14
            this.lineSelectWin.Closed += new EventHandler(lineSelectWin_Closed);

            // 案件名  ...按钮 v2.14
            this.btnMatterName.Click += new RoutedEventHandler(btnMatterName_Click);
            // 案件名查询子窗体关闭事件 v2.14
            this.matterNameSelectWin.Closed += new EventHandler(matterNameSelectWin_Closed);


            // 帐票种类 ...按钮的单击事件 委托 2.15 
            this.btnACCOUNTVOTES.Click += new RoutedEventHandler(btnACCOUNTVOTES_Click);
            // 帐票种类查询子窗体关闭事件 v2.15
            this.striptTypeSelectWin.Closed += new EventHandler(striptTypeSelectWin_Closed);

            // WordType（文字种类）  ...按钮 v2.15
            this.btnWORD.Click += new RoutedEventHandler(btnWORD_Click);
            // WordType（文字种类）查询子窗体关闭事件 v2.15
            this.wrodTypeSelectWin.Closed += new EventHandler(wrodTypeSelectWin_Closed);

            // JobClass（job种类）  ...按钮 v2.15
            this.btnJOB.Click += new RoutedEventHandler(btnJOB_Click);
            // JobClass（job种类）查询子窗体关闭事件 v2.15
            this.jobClassSelectWin.Closed += new EventHandler(jobClassSelectWin_Closed);


            #endregion 对...按钮的单击事件 委托

            this.Loaded += new RoutedEventHandler(StaffSelContainer_Loaded);

            // 查询符合条件的OP信息
            this.btnSelectAllInfor.Click += new RoutedEventHandler(this.BtnSelectAllInfor_Click);

            // 开始日期(DatePicker)
            this.dpDateFrom.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(this.DpDateFrom_SelectedDateChanged);

            // 结束日期(DatePicker)
            this.dpDateTo.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(this.DpDateTo_SelectedDateChanged);


            this.btnExport.Click += new RoutedEventHandler(this.BtnExport_Click);


            // 如果不是 SV或QC，显示导出按钮
            if (!(FunctionClass.GetUserIdentity() == FunctionClass.UserIdentity.SV.ToString() ||
                    FunctionClass.GetUserIdentity() == FunctionClass.UserIdentity.QC.ToString()))
            {
                this.btnExport.Visibility = Visibility.Visible;
            }
            else
            {
                this.btnExport.Visibility = Visibility.Collapsed;
            }

 
        }

        /// <summary>
        /// Gets or sets vlaue of exportComand
        /// 导出命令 ExportComand
        /// </summary>
        public Command.ICommand ExportComand
        {
            get { return this.exportComand; }
            set { this.exportComand = value; }
        }

        /// <summary>
        /// Gets or sets value of queryCcommand
        /// 查询命令 QueryCcommand
        /// </summary>
        public Command.ICommand QueryCcommand
        {
            get { return this.queryCcommand; }
            set { this.queryCcommand = value; }
        }        

        /// <summary>
        /// 页面载入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void StaffSelContainer_Loaded(object sender, RoutedEventArgs e)
        {
            

            this.dpDateFrom.SelectedDate = DateTime.Now.AddDays(-1);

            this.dpDateTo.SelectedDate = DateTime.Now.Date;

            this.wcfCommonQueryClient.TagInforAsync();


        }

        /// <summary>
        /// 变量初始化方法  InitField
        /// </summary>
        private void InitField()
        {
            this.btnSelectAllInfor.IsEnabled = true;

            this.wcfCommonQueryClient = Wcf.Service.CommonQuery;
            this.wcfLogClient = Wcf.Service.Log4;
            this.errorMessbox = new childWindow.MessageBox();

            // 04/22/2011 Add v2.14
            this.lineSelectWin = new LineSelChildWin();
            // 04/25/2011 add 2.14
            this.matterNameSelectWin = new MatterNameSelChildWin(MatterShape.MatterValue.ToString(), MatterShape.MatterValue.ToString());
            // 07/05/0211 add 2.15
            this.striptTypeSelectWin = new ScriptTypeSelChildWin();
            // 07/06/0211 add 2.15
            this.wrodTypeSelectWin = new WordTypeSelChildWin();
            this.jobClassSelectWin = new JobClassSelChildWin();

        }

        /// <summary>
        /// 导出按钮 点击事件 BtnExport_Click
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void BtnExport_Click(object sender, RoutedEventArgs e)
        {
            writeWhereLog();
            this.exportComand.Exec();
        }

        /// <summary>
        /// 查询按钮 点击事件 BtnSelectAllInfor_Click
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void BtnSelectAllInfor_Click(object sender, RoutedEventArgs e)
        {
            writeWhereLog();
            this.btnSelectAllInfor.IsEnabled = false;
            this.queryCcommand.Exec();
        }


        #region 日期(DatePicker)
        /// <summary>
        /// 结束日期(DatePicker)
        /// DpDateTo_SelectedDateChanged
        /// </summary>
        /// <param name="sender">sender of obejct</param>
        /// <param name="e">e type of SelectionChangedEventArgs</param>
        private void DpDateTo_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dpDateTo == null || dpDateTo.SelectedDate == null)
            {
                return;
            }
            else
            {
                this.dpDateTo.Text = this.dpDateTo.SelectedDate.Value.ToString("yyyy-MM-dd");
            }
        }

        /// <summary>
        /// 开始日期(DatePicker)
        /// 防止选错时，出现BUG
        /// </summary>
        /// <param name="sender">sender of object</param>
        /// <param name="e">e type of SelectionChangedEventArgs</param>
        private void DpDateFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dpDateFrom == null || dpDateFrom.SelectedDate == null)
            {
                return;
            }
            else
            {
                this.dpDateFrom.Text = this.dpDateFrom.SelectedDate.Value.ToString("yyyy-MM-dd");
            }
        }

        #endregion 日期(DatePicker)

        #region 记录用户选择的WHERE条件
        /// <summary>
        /// 记录用户选择的WHERE条件
        /// </summary>
        /// <returns></returns>
        /// <value>
        /// 10/15/2010 Add 
        /// 04/26/2011 增加 线路、案件名 LOG记录 add v2.14 
        /// </value>
        private void writeWhereLog()
        {
            StringBuilder sbWhereIntorLogs = new StringBuilder();
            try
            {
                //日志用
                sbWhereIntorLogs.Append(" 查询条件：");
                sbWhereIntorLogs.Append(" 开始日期：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.dpDateFrom.Text) == true ? " null" : this.dpDateFrom.Text);
                sbWhereIntorLogs.Append(" 结束日期：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.dpDateTo.Text) == true ? " null" : this.dpDateTo.Text);
                sbWhereIntorLogs.Append(" 帐票种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbACCOUNTVOTES.Text) == true ? " null" : this.tbACCOUNTVOTES.Text);
                sbWhereIntorLogs.Append(" JOB种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbJOB.Text) == true ? " null" : this.tbJOB.Text);
                sbWhereIntorLogs.Append(" 文字种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbWordType.Text) == true ? " null" : this.tbWordType.Text);

                // 04/26/2011 增加 线路、案件名 LOG记录 add v2.14 
                sbWhereIntorLogs.Append(" 线路：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbSelContext.Text) == true ? " null" : this.tbSelContext.Text);
                sbWhereIntorLogs.Append(" 案件名：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbMatterName.Text) == true ? " null" : this.tbMatterName.Text);

            }
            catch
            {
                WhereIntorLogs = string.Empty;
            }

            WhereIntorLogs = sbWhereIntorLogs.ToString();
        }

        #endregion 记录用户选择的WHERE条件

        #region LINE线路子窗体相关 v2.14
        /// <summary>
        /// LINE线路子窗体关闭
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void lineSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.lineSelectWin = sender as childWindow.LineSelChildWin;

                if (this.lineSelectWin.DialogResult == true)
                {
                    //将LINE记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelLineList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelLineList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbSelContext.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbSelContext.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbSelContext.Text = string.Empty;
                        this.tbSelContext.Text = this.lineSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbSelContext.Text = string.Empty;
                    }
                }

                if (this.lineSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbSelContext.Text = string.Empty;
                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " lineSelectWin_Closed 转换Line信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        /// <summary>
        /// ... 按钮，显示LINE子窗体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnSelContext_Click(object sender, RoutedEventArgs e)
        {
            this.lineSelectWin.Title = "线路查询子窗体";
            this.lineSelectWin.Show();
        }

        #endregion LINE线路子窗体相关

        #region 案件名查询子窗相关

        /// <summary>
        ///... 按钮，显示案件名子窗体
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnMatterName_Click(object sender, RoutedEventArgs e)
        {
            this.matterNameSelectWin.Title = "案件名查询子窗体";
            this.matterNameSelectWin.Show();
        }

        /// <summary>
        /// 案件名查询子窗体关闭事件
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        /// <value>04/25/2011 add v2.14</value>
        void matterNameSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.matterNameSelectWin = sender as childWindow.MatterNameSelChildWin;

                if (this.matterNameSelectWin.DialogResult == true)
                {
                    //将LINE记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelMatterNamesList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelMatterNamesList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbMatterName.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbMatterName.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbMatterName.Text = string.Empty;
                        this.tbMatterName.Text = this.matterNameSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbMatterName.Text = string.Empty;
                    }
                }

                if (this.matterNameSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbMatterName.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " matterNameSelectWin_Closed 转换案件名信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        #endregion 案件名查询子窗相关


        #region 帐票查询子窗体相关
        /// <summary>
        ///  ...按钮 显示帐票种类子窗体
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnACCOUNTVOTES_Click(object sender, RoutedEventArgs e)
        {
            this.striptTypeSelectWin.Title = "帐票种类查询子窗体";
            this.striptTypeSelectWin.Show();
        }

        /// <summary>
        /// 帐票种类查询子窗体关闭事件
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void striptTypeSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.striptTypeSelectWin = sender as childWindow.ScriptTypeSelChildWin;

                if (this.striptTypeSelectWin.DialogResult == true)
                {
                    //将帐票种类记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelScriptTypeList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelScriptTypeList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbACCOUNTVOTES.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbACCOUNTVOTES.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbACCOUNTVOTES.Text = string.Empty;
                        this.tbACCOUNTVOTES.Text = this.striptTypeSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbACCOUNTVOTES.Text = string.Empty;
                    }
                }

                if (this.striptTypeSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbACCOUNTVOTES.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " striptTypeSelectWin_Closed 转换帐票种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        #endregion 帐票查询子窗体相关

        #region WordType（文字种类）查询子窗体相关
        /// <summary>
        /// WordType（文字种类）查询子窗体关闭事件 v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void wrodTypeSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.wrodTypeSelectWin = sender as childWindow.WordTypeSelChildWin;

                if (this.wrodTypeSelectWin.DialogResult == true)
                {
                    //将WordType记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelWordTypeList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelWordTypeList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbWordType.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbWordType.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbWordType.Text = string.Empty;
                        this.tbWordType.Text = this.wrodTypeSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbWordType.Text = string.Empty;
                    }
                }

                if (this.wrodTypeSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbWordType.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " wrodTypeSelectWinWin_Closed 转文字种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        /// <summary>
        /// WordType（文字种类）  ...按钮 v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnWORD_Click(object sender, RoutedEventArgs e)
        {
            this.wrodTypeSelectWin.Title = "文字种类查询子窗体";
            this.wrodTypeSelectWin.Show();
        }

        #endregion WordType（文字种类）查询子窗体相关

        #region JobClass（job种类）查询子窗体相关
        /// <summary>
        /// JobClass（job种类）  ...按钮 
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The  instance containing the event data.</param>
        void btnJOB_Click(object sender, RoutedEventArgs e)
        {
            this.jobClassSelectWin.Title = "Job种类查询子窗体";
            this.jobClassSelectWin.Show();
        }

        /// <summary>
        /// JobClass（job种类）查询子窗体关闭v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void jobClassSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.jobClassSelectWin = sender as childWindow.JobClassSelChildWin;

                if (this.jobClassSelectWin.DialogResult == true)
                {
                    //将JobClass记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelJobClassList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelJobClassList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbJOB.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbJOB.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbJOB.Text = string.Empty;
                        this.tbJOB.Text = this.jobClassSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbJOB.Text = string.Empty;
                    }
                }

                if (this.jobClassSelectWin.DialogResult == false)
                {

                    this.tbJOB.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " jobClassSelectWinWin_Closed 转文字种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }


        #endregion JobClass（job种类）查询子窗体相关

    }
}
